package String类编程题;

import java.util.Scanner;

public class Question2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("Enter a java file's name:(eg. Test.java)");
        String filename = in.nextLine();
        System.out.println("是否以.java结尾: "+filename.endsWith(".java"));
        System.out.println(".符号的索引位置: "+filename.lastIndexOf("."));
    }
}
